<?php

namespace App\Models\Teaching;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

class TeachingComment extends Model
{
    protected $table = 'teaching_comments';
    protected $guarded = [];
    protected $hidden = [
        'updated_at'
    ];
    protected $appends = [
        'comment_date'
    ];
    
    public function getCommentDateAttribute(){
        $createdAt = $this->attributes['created_at'];
        
        $result = Carbon::parse($createdAt)->format('Y-m-d H:m');
        
        return $result;
    }
}
